#ifndef sqlite3_cfg_h
#define sqlite3_cfg_h

#include <QObject>


class Sqltie3Util;

/// ----------------------------------------------------------------------------
/// @brief: 配置文件读写类
/// ----------------------------------------------------------------------------
class Sqlite3Config : public QObject
{
	Q_OBJECT

public:
	explicit Sqlite3Config(QObject *parent = nullptr);
	~Sqlite3Config();
	/// ----------------------------------------------------------------------------

	/// ----------------------------------------------------------------------------
	/// @brief：		初始化
	/// @param: 	const QString & str_db_file - sqlite3 file
	/// @return: 	int - 无
	/// 			0 - 成功
	///				1 - 失败
	/// ----------------------------------------------------------------------------
	int init_(const QString& str_db_file);
	


	/// ----------------------------------------------------------------------------
	/// @brief：		加载数据库
	/// @return: 	int - 无
	/// 			
	/// ----------------------------------------------------------------------------
	int load_();

	/// ----------------------------------------------------------------------------
	/// @brief：		执行sql语句
	/// @param: 	const QString & str_sql - str_sql
	/// @return: 	int - 无
	/// 			
	/// ----------------------------------------------------------------------------
	int exec_(const QString& str_sql);




private:
	/// ----------------------------------------------------------------------------
	/// @brief：		uninit_
	/// @return: 	void - 无
	/// 			
	/// ----------------------------------------------------------------------------
	void uninit_();


private:
	Sqltie3Util* psu_			= nullptr;

};


#endif /// sqlite3_cfg_h